#region Copyright
/// <copyright>
/// Copyright (c) 2007 Ilia Shramko.
/// Released under the terms of the GNU General Public License.
/// </copyright>
#endregion

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Runtime.InteropServices;
using System.Text;

namespace Osh.Configuration
{
	public interface IPlayerElement : IConfigurationElement
	{
		string Name { get; set; }
		string Type { get; set; }
		bool Enabled { get; set; }
	}

	[ClassInterface(ClassInterfaceType.None)]
	public class PlayerElement : ConfigurationElement, IPlayerElement
	{
		public PlayerElement()
		{
			this.Enabled = true;
		}

		public PlayerElement(string name, string type, bool enabled)
		{
			this.Name = name;
			this.Type = type;
			this.Enabled = enabled;
		}

		[ConfigurationProperty("name", IsRequired = true, IsKey = true)]
		public string Name
		{
			get { return (string)this["name"]; }
			set { this["name"] = value; }
		}
		 
		[ConfigurationProperty("type", IsRequired=true)]
		public string Type
		{
			get { return (string)this["type"]; }
			set { this["type"] = value; }
		}

		[ConfigurationProperty("enabled", DefaultValue = true, IsRequired = false)]
		public bool Enabled
		{
			get { return (bool)this["enabled"]; }
			set { this["enabled"] = value; }
		}
	}
}
